<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<meta http-equiv="pragma" content="no-cache"> 
		<meta http-equiv="cache-control" content="no-cache"> 
		<meta http-equiv="expires" content="0"> 
		<script type="text/javascript" src="./jquery-easyui-1.3.5/jquery.min.js"></script>
		<script type="text/javascript" src="./js/customize.js"></script>
        <link rel="stylesheet" type="text/css" href="./css/customize.css">  
 
   <%//设置无缓存
  	 response.setHeader("Pragma","No-cache");          
     response.setHeader("Cache-Control","no-cache");   
     response.setHeader("Cache-Control", "no-store");   
     response.setDateHeader("Expires",0); 
   %>
   
<title>登陆页面</title>
<div style="dispaly:none;">
	<input type="text" id="MSG" value="<s:property value='#request.msg'/>" style="border:0;display:none"/>
</div>
<script type="text/javascript">

var msg;

function not1(){
    notif({
		msg: "<b>"+msg+"</b>",
		type: "success"
	});
}

if(document.getElementById("MSG").value!=undefined&&document.getElementById("MSG").value!=null&&document.getElementById("MSG").value!=""&&document.getElementById("MSG").value!="null"){
	
	//msg="请您先登录！";
	msg=document.getElementById("MSG").value;
	not1();
}  


window.onload = function()
{
    var buttonpic = document.getElementById("button");
    
    buttonpic.onmouseover = function()
    {
        this.src="images/loginbutton2.png";
    }
    buttonpic.onmouseout = function()
    {
        this.src="images/loginbutton.png";
    }
    document.getElementById("randImage").src = "<%=basePath%>baseJSP/code.jsp?"+Math.random(); 
}


    function loginCheck()
    {

            var username = document.getElementById("username").value;
            var password = document.getElementById("password").value;
            //var rand_num = document.getElementById("rand_num").value;
                        
            if( username=="")
            {
            	msg="请输入用户名！";           	
            	not1();
              return false;
            }
            else if(password=="")
            {
            	msg="请输入密码！";
            	not1();
                return false;
             }
           /*   else if(rand_num=="")
            {
             	msg="请输入验证码！";
            	not1();
                return false; 
            }  */
            else
            {
				return true;
			} 
	}         



<%-- 	function loadimage(){ 
		alert("");
		document.getElementById("randImage").src = "<%=basePath%>baseJSP/code.jsp?"+Math.random(); 
	} --%>


</script>
</head>
<body style="margin:0;">
    <div>
    	<img src="images/background.jpg" width="100%" height="100%"/>
        <img src="images/login_rectangle.png" style="position:absolute;left:950px;top:120px";width="430px";height="561px">
    </div>
    <form action="User_LoginAction" id="loginform" method="post"  onsubmit="return loginCheck(this)">

<%--      <div style="position:absolute;left:1062px;top:220px;">
    	 <font id="result" size="3" style="color:red"><s:property value="MSG"/></font>
	</div>  --%>
    <div name="username" style="position:absolute;left:1062px;top:240px;">
           <tr>             
           <td>
           <input name="loginbean.userName" id="username" type="text" style="width:270px;height:62px;border:0;" />
           </td>
           <div><font id="usernamecheck" size="3" style="color:yellow;"></font></div>
           </tr>
    </div>
  <img src="images/user.png" style="position:absolute;left:1000px;top:240px;" width="62px";height="62px">
           
    <div style="position:absolute;left:1062px;top:320px;">       
              <tr>
                <td>
                <input name="loginbean.password" id="password" type="password" onblur="" style="width:270px;height:62px;border:0;"/>
                </td>
                <div><font id="passwordcheck" style="color:yellow"></font></div>
              </tr>
    </div>
   <img src="images/password.png" style="position:absolute;left:1000px;top:320px;" width="62px";height="62px">
              
    <div style="position:absolute;left:1062px;top:420px;color:red;">  

       <%-- <s:property value="msg"></s:property> --%>
       <font id="code_erro" style="color:yellow"></font>

    </div>    
    <div style="position:absolute;left:1062px;top:450px;color:red;">  
		<tr> 
			<td width="150"><input type="text" id="rand_num" name="rand_code" size="10" style="height:62px;border:0"></td> 
			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td width="150"><img alt="code..." name="randImage" id="randImage" src="code.jsp" width="130" height="62" border="1" align="absmiddle"></td> 
		</tr> 
		<div>
		<tr> 
			<td height="50" colspan="2"><a href="javascript:loadimage();"><font style="color:white">看不清点我</font></a></td> 
		</tr> 
		</div>
    </div>  
    <img src="images/identification.png" style="position:absolute;left:1000px;top:450px;" width="62px";height="62px">
    
    <div style="position:absolute;left:1000px;top:560px;">
      	<input type=image id="button" src="images/loginbutton.png"/>
	
	</div>
	
</form>
    <%
    response.setHeader("Pragma","No-cache");          
    response.setHeader("Cache-Control","no-cache");   
    response.setHeader("Cache-Control", "no-store");   
    response.setDateHeader("Expires",0);
    if(session!=null)
        session.invalidate();
    %>
</body>
</html>

